const protoConfig = {
  width: "100%",
  height: "100%",
  margin: {
    top: 0,
    right: 0,
    bottom: 0,
    left: 0
  },
  target: 'body'
};

export default function (opt = {}) {
  let config = Object.assign({}, protoConfig, opt);

  this.config = config;

  this.svg = d3.select(`${config.target}`).append('svg')
    .attr('width', config.width)
    .attr('height', config.height);
  this.container = this.svg.append('g').attr('class', 'container')
    .attr('transform', `translate(${config.margin.left}, ${config.margin.top})`);
}